﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Web.Mvc;
using System.IO;
using MvcEngine.Core;
using System.Reflection;
using System.Linq.Expressions;
using MvcEngine.Core.Validation;
using System.Web.Routing;
using System.Globalization;
using System.Web;
using MvcEngine.Core.Helpers;
using MvcEngine.Mvc.Extensions;

namespace MvcEngine.Mvc.UI
{
    public class ValidationView
    {
        private readonly ValidatorBuilderBase builder = null;

        public ValidationView(ValidatorBuilderBase builder)
        {
            this.builder = builder;
        }

        public ValidationView Items(Action<ValidationView> item)
        {
            item(this);
            return this;
        }

        public ValidationViewItem For(string name)
        {
            var item = new ValidationViewItem(name);
            builder.Items.Add(item);
            return item;
        }

        public override string ToString()
        {
            return builder.ToString();
        }
    }
}
